﻿#ifndef IMYSQL_H
#define IMYSQL_H

#include "IDatabase.h"
#include <QObject>

class IMysql : public IDatabase
{
    Q_OBJECT
public:
    IMysql(QObject* parent = nullptr);
    IMysql(const SqlLinkParam &par, QObject* parent = nullptr);
public:
    bool init() override;
protected:
    virtual void setSqlState(SqlState state) override;
private:
    bool connect();
    bool createDatabase();
    bool createTable();
    bool checkIpStatus();
    bool checkSqlEnable();
    void reconnect();
private:
    QTimer* mTimerReconnect;
};

#endif // IMYSQL_H
